export default {
  // Global page headers (https://go.nuxtjs.dev/config-head)
  head: {
    title: 'nuxt-demo',
    meta: [
      { charset: 'utf-8' },
      { name: 'viewport', content: 'width=device-width, initial-scale=1' },
      { name: 'keywords', content: 'keyword 1, keyword 2, config'},
      { hid: 'description', name: 'description', content: 'description config' }
    ],
    link: [
      { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
    ]
  },

  // Global CSS (https://go.nuxtjs.dev/config-css)
  css: [
    'element-ui/lib/theme-chalk/index.css'
  ],

  // Plugins to run before rendering page (https://go.nuxtjs.dev/config-plugins)
  plugins: [
    '@/plugins/element-ui'
  ],

  // Auto import components (https://go.nuxtjs.dev/config-components)
  components: true,

  // Modules for dev and build (recommended) (https://go.nuxtjs.dev/config-modules)
  buildModules: [
  ],

  // Modules (https://go.nuxtjs.dev/config-modules)
  modules: [
    '@nuxtjs/axios',
    '@nuxtjs/proxy'
  ],
  axios:{
    proxy:true
  },
  proxy: {
    '/ajax':{ target: 'https://m.maoyan.com', changeOrigin:true, pathRewrite: { '^/ajax': '/ajax' } },
    '/dog':{ target: 'https://dog.ceo/', changeOrigin:true, pathRewrite: { '^/dog': '/api/breeds/image/random' } },
    '/api':{ target: 'http://47.90.203.35:1013', changeOrigin:true, pathRewrite: { '^/api': '/api' } }
  },
  // proxy: [
  //   ['/dog', { target: 'https://dog.ceo/', pathRewrite: { '^/dog': '/api/breeds/image/random' } }],
  //   ['/api', { target: 'http://47.90.203.35:1013', pathRewrite: { '^/dev-api/api': '/api'} }]
  // ],
  // Build Configuration (https://go.nuxtjs.dev/config-build)
  build: {
    transpile: [/^element-ui/],
  }
}
